package org.feifei.order.service.impl;

import org.feifei.basic.service.impl.BaseServiceImpl;
import org.feifei.order.domain.AdoptOrder;
import org.feifei.order.domain.ProductOrderDetail;
import org.feifei.order.mapper.ProductOrderDetailMapper;
import org.feifei.order.service.ProductOrderDetailService;
import org.feifei.pay.domain.PayBill;
import org.feifei.pay.mapper.PayBillMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author forever
 * @Description: 商品服务详情的Service层
 * @date 2021/12/20 10:27
 */
@Service
public class ProductOrderDetailServiceImpl extends BaseServiceImpl<ProductOrderDetail> implements ProductOrderDetailService {

    @Resource
    private ProductOrderDetailMapper productOrderDetailMapper;


    @Override
    public void cancelOrder(long oid) {
        ProductOrderDetail productOrderDetail = productOrderDetailMapper.getByOrderId(oid);
        productOrderDetail.setState(-1);//取消订单
        productOrderDetailMapper.update(productOrderDetail);

    }

    @Override
    public ProductOrderDetail getByOrderId(Long productOrderId) {
        return productOrderDetailMapper.getByOrderId(productOrderId);
    }
}
